﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DataChannel.Web
{
    public class UserValidTask
    {
        public string UserID
        {
            get;
            set;
        }
        public string TaskName
        {
            get;
            set;
        }
        public string TableName
        {
            get;
            set;
        }
        public string Description
        {
            get;
            set;
        }
        public string Create_Time
        {
            get;
            set;
        }
        public string Expire_Time
        {
            get;
            set;
        }

    }


    public class UserInfor
    {
        public string ID
        {
            get;
            set;
        }

        public string Name
        {
            get;
            set;
        }

        public string Channel_ID
        {
            get;
            set;
        }

        public string Channel_Name
        {
            get;
            set;
        }


        public string[] Auths
        {
            get;
            set;

        }

        public bool isAuth(string authid)
        {
            //admin
            if (Auths.Contains<string>("1"))
            {
                return true;
            }

            var query = from p in Auths
                        where p == authid
                        select p;
            return query.Any();
        }

    }


    public class TaskInfor
    {
        public int Task_ID
        {
            get;
            set;

        }
        public string Task_Name
        {
            get;
            set;
        }
        public string Table_Name
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public DateTime Create_Time
        {
            get;
            set;
        }
        public DateTime Expire_Time
        {
            get;
            set;
        }
    }
}
